// pages/component/component.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    proList: [],
    username: "",
    url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fd1b523fe-4413-4efe-92f0-92d8115f4a80%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1712280431&t=0396de0c12e518c16cda4cf3963d97c7",
    indicatorDots: true,
    arr: ["https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fea86243a-a102-49d3-90e5-f48d3b909b94%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1712282119&t=f81731b38ff4d6a00cb61c48909cecd4", "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F8d6c857b-fd2e-40c2-a489-f45013db9504%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1712282119&t=53d89503f4a196743eaffc385f4d5098", "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fa6049a93-763d-4895-8552-cd0eec4fceea%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1712282119&t=02b415db1ab62c423022a91263b52957"]
  },

  fn() {
    console.log(this.data.username);
  },

  fn2() {
    // wx.getSystemInfo({
    //   success: function(res) {
    //     console.log(res)
    //   },
    //   fail() {},
    //   complete() {}
    // })

    // let use = wx.canIUse('live-player');
    // console.log(use);

    // wx.showToast({
    //   title: '成功',
    //   icon: 'success',
    //   duration: 2000
    // })


    // 数据请求(调用后端接口)
    // wx.request({
    //   url: 'http://121.89.205.189:3000/api/pro/list', // 后端地址
    //   data: {}, // 前端要传给后端的数据
    //   header: {
    //     'content-type': 'application/json' // 默认值
    //   },
    //   success (res) { // res就是请求成功得到的结果
    //     console.log(res.data)
    //   }
    // })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    wx.request({
      url: 'http://121.89.205.189:3000/api/pro/list', // 后端地址
      data: {}, // 前端要传给后端的数据
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: (res) => { // res就是请求成功得到的结果
        // console.log(res.data)
        this.setData({
          proList: res.data.data
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})